<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="onein" uri="http://www.onein.cn/jsp/taglib"%>
<%@ page import="cn.onein.edu.web.common.base.BaseController" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用户登录  | 万应教育</title>
<jsp:include page="/WEB-INF/inc/meta.jsp"/>
<link href="<onein:url value="/styles/all.css"/>" type="text/css" rel="stylesheet" />
<script src="<onein:url value="/scripts/jquery.js"/>" type="text/javascript"></script>
<script type="text/javascript">
function login(){
	var success = true;
	
	if($("#userName").val() == ""){
        document.getElementById("userNameErr").style.display = ""; // 显示
        success = false;
    }
	if($("#password").val() == ""){
        document.getElementById("passwordErr").style.display = ""; // 显示
        success = false;
    }
	
	if(success == true){
		$("#loginForm").submit();
	}
}

function loseblur(type){
    document.getElementById(type).style.display = "none"; // 隐藏
    
    if("userNameErr" == type){
        if($("#userName").val() == ""){
        	document.getElementById(type).style.display = ""; // 显示
        }
    }
    else if("passwordErr" == type){
    	if($("#password").val() == ""){
            document.getElementById(type).style.display = ""; // 显示
        }
    }
}

</script>
</head>
<%
request.setAttribute(BaseController.MENU_KEY, BaseController.MENU_VALUE_LOGIN);
String type = request.getParameter("type");
if(type != null && "redirect".equals(type)){
	request.setAttribute(BaseController.INFO_MESSAGE_KEY,"您还没有登陆或者会话已超时！");
}
%>
<body onload="document.forms[0].userName.focus();">
    <jsp:include page="/WEB-INF/inc/header.jsp"/>
    <jsp:include page="/WEB-INF/inc/menu.jsp"/>
<form id="loginForm" action="<onein:url value="/login" />" method="post">
    <input type="hidden" name="action" value="login"/>
    <div id="bodyWrap">
      <h2 style="margin:10px 0 0 75px;font-size:14px">用户登陆</h2>
      <div class="regSelectAgesSelected">
        <ul class="regTextWrap">
            <li class="regTh" style="margin-left:177px;">邮箱/用户名:</li>
            <li><input tabindex="1" name="userName" id="userName" type="text" value="${userName}" class="textBox" onblur="loseblur('userNameErr')" maxlength="50"/></li>
            <li class="regSatu" id="userNameErr" style="display:none;">邮箱/用户名不能为空.</li>
        </ul>
        <ul class="regTextWrap">
            <li class="regTh" style="margin-left:177px;">登陆密码:</li>
            <li><input tabindex="2" name="password" id="password" type="password" class="textBox" onkeydown="if(event.keyCode==13)login();" onblur="loseblur('passwordErr')" maxlength="50"/></li>
            <li class="regSatu" id="passwordErr" style="display:none;">登录密码不能为空.</li>            
        </ul>
        <div style="margin-top:90px;"><input tabindex="3" name="savepassword" type="checkbox" value="true" checked="checked"/><span style="line-height:24px;font-size:14px;">记住登录</span></div>
        <c:if test="${INFO_MESSAGE_KEY != null}">
            <div class="messageArea" >
                <div class="info" style="width:195px;">${INFO_MESSAGE_KEY }</div>
            </div>
        </c:if>
        <c:if test="${ERROR_MESSAGE_KEY != null}">
            <div class="messageArea">
                <div class="error" style="width:175px;">${ERROR_MESSAGE_KEY }</div>
            </div>
        </c:if>
        <div  style="margin-left:300px;margin-top:20px;">
          <ul class="regTextWrap">
            <li>
               <div>
                     <a tabindex="4" href="#" onclick="javascript:login();" class="botton1"><span style="font-size:14px;">登　陆</span></a>
                     <a style="margin-left:10px;" href="<onein:url value="/forgetPaassword" />">忘记密码？</a>
                </div>
            </li>
          </ul>
          
         
          </div>
        <div class="ca"></div> 
      </div>
     <div class="ca"></div>
</div>
</form>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<jsp:include page="/WEB-INF/inc/footer.jsp"/>
</body>
</html>
